<%@include file="/WEB-INF/common/taglibs.jsp"%>
<script type="text/javascript" src="${ctx}/resources/js/datatable-query.js"></script>
<script type="text/javascript" src="${supr}/js/widgets.js"></script>
<script type="text/javascript" src="${ctx}/resources/js/admin/shop.js"></script>


<script>
$(document).ready(function(){
	$("form.form-horizontal.seperator[method='post']").validate();
});
	
	
 </script>
<div class="row-fluid">

	<div class="span12">

		<div class="page-header">
			<h4>Coupon </h4>
		</div>

<form class="form-horizontal seperator" method="post">
<!--name --><div class="form-row row-fluid"><div class="span12"><div class="row-fluid"><label class="form-label span3" for="name">Name :</label><input class="span4" id="name" name="name"   type="text" value="${entity.name}" /></div></div></div>
<!--code --><div class="form-row row-fluid"><div class="span12"><div class="row-fluid"><label class="form-label span3" for="code">Code :</label><input class="span4" id="code" name="code"   type="text" value="${entity.code}" /></div></div></div>
<!--couponType --><div class="form-row row-fluid"><div class="span12"><div class="row-fluid"><label class="form-label span3">Coupon Type :</label><div class="span4 controls"><select name="couponType"><c:if test="${not empty couponTypes}"><c:forEach var="single" items="${couponTypes}"><option value="${single}"${(single == entity.couponType)?'selected':'' }>${single}</option></c:forEach></c:if></select></div></div></div></div>
<!--discount --><div class="form-row row-fluid"><div class="span12"><div class="row-fluid"><label class="form-label span3" for="discount">Discount :</label><input class="span4" id="discount" name="discount"   type="text" value="${entity.discount}" /></div></div></div>
<!--totalAmount --><div class="form-row row-fluid"><div class="span12"><div class="row-fluid"><label class="form-label span3" for="totalAmount">TotalAmount :</label><input class="span4" id="totalAmount" name="totalAmount"   type="text" value="${entity.totalAmount}" /></div></div></div>
<!--customerLogin --><div class="form-row row-fluid"><div class="span12"><div class="row-fluid"><label class="form-label span3" for="customerLogin">CustomerLogin :</label><div class="left marginT5 marginR10"><div class="radio" id="uniform-customerLogin1"><span class="<c:if test="${entity.customerLogin }">checked</c:if>"><input type="radio" name="customerLogin" id="customerLogin1" value="true" <c:if test="${entity.customerLogin}">checked="checked"</c:if> style="opacity: 0;"></span></div>True</div><div class="left marginT5 marginR10"><div class="radio" id="uniform-customerLogin2"><span class="<c:if test="${!entity.customerLogin}">checked</c:if>"><input type="radio" <c:if test="${!entity.customerLogin}">checked="checked"</c:if>name="customerLogin" id="customerLogin2" value="false" style="opacity: 0;"></span></div>False</div></div></div></div>
<!--freeShipping --><div class="form-row row-fluid"><div class="span12"><div class="row-fluid"><label class="form-label span3" for="freeShipping">FreeShipping :</label><div class="left marginT5 marginR10"><div class="radio" id="uniform-freeShipping1"><span class="<c:if test="${entity.freeShipping }">checked</c:if>"><input type="radio" name="freeShipping" id="freeShipping1" value="true" <c:if test="${entity.freeShipping}">checked="checked"</c:if> style="opacity: 0;"></span></div>True</div><div class="left marginT5 marginR10"><div class="radio" id="uniform-freeShipping2"><span class="<c:if test="${!entity.freeShipping}">checked</c:if>"><input type="radio" <c:if test="${!entity.freeShipping}">checked="checked"</c:if>name="freeShipping" id="freeShipping2" value="false" style="opacity: 0;"></span></div>False</div></div></div></div>


				<div class="form-row row-fluid">
												<div class="span12">
													<div class="row-fluid">
														 <label class="form-label span3" for="combobox">Categories :</label>
														 <div class="span8 controls">
															<select class="nostyle autoselect tab-select" inputName="categoryId[]" >
																<option value="">Select one...</option>
																<c:forEach var="single" items="${categories}">
 																	<option  value="${single.id}" /> ${single.name}</option>
 																</c:forEach>
															
															</select>
														</div> 
													</div>
												</div>
											</div>
											<div class="form-row row-fluid">
												<div class="span12">
													<div class="row-fluid">
														<label class="form-label span3" ></label>
														<div class="span6">
															<div class="box plain box-with-clear-table">
																<div class="title">	
																</div>
																<div class="content content-with-clear-table">
																	<div class="scroll" style="height:200px; overflow:auto; margin-top:0px;">
																		<table  class="table  table-striped clear-table autoselect-table" width="100%">
																			<tbody>
																				<c:forEach var="single" items="${entity.categories}">
																				<tr >
																					<td>${single.name}</td>
																					<td style="text-align:right;"><a class="deltr"><span class="icomoon-icon-minus-circle-2"></span></a></td>
																					<input type="hidden" name="categoryId[]" value="${single.id}">
																				</tr>																				
																				</c:forEach>
 																			</tbody>
																		</table>																
																	</div>
																</div>
															</div>
														</div>												
													</div>
												</div>
											</div>




<div class="form-row row-fluid">
												<div class="span12">
													<div class="row-fluid">
														 <label class="form-label span3" for="combobox">Products :</label>
														 <div class="span8 controls">
															<select class="nostyle autoselect tab-select" inputName="productId[]" >
																<option value="">Select one...</option>
																<c:forEach var="single" items="${products}">
 																	<option  value="${single.id}" /> ${single.name}</option>
 																</c:forEach>
															
															</select>
														</div> 
													</div>
												</div>
											</div>
											<div class="form-row row-fluid">
												<div class="span12">
													<div class="row-fluid">
														<label class="form-label span3" ></label>
														<div class="span6">
															<div class="box plain box-with-clear-table">
																<div class="title">	
																</div>
																<div class="content content-with-clear-table">
																	<div class="scroll" style="height:200px; overflow:auto; margin-top:0px;">
																		<table  class="table  table-striped clear-table autoselect-table" width="100%">
																			<tbody>
																				<c:forEach var="single" items="${entity.products}">
																				<tr >
																					<td>${single.name}</td>
																					<td style="text-align:right;"><a class="deltr"><span class="icomoon-icon-minus-circle-2"></span></a></td>
																					<input type="hidden" name="productId[]" value="${single.id}">
																				</tr>																				
																				</c:forEach>
 																			</tbody>
																		</table>																
																	</div>
																</div>
															</div>
														</div>												
													</div>
												</div>
											</div>



<!--dateStart --><div class="form-row row-fluid"><div class="span12"><div class="row-fluid"><label class="form-label span3" for="dateStart">DateStart :</label><input class="span4 datepicker" id="dateStart" name="dateStart" type="text" value="<fmt:formatDate pattern="yyyy-MM-dd" value="${entity.dateStart}" />" /></div></div></div>
<!--dateEnd --><div class="form-row row-fluid"><div class="span12"><div class="row-fluid"><label class="form-label span3" for="dateEnd">DateEnd :</label><input class="span4 datepicker" id="dateEnd" name="dateEnd" type="text" value="<fmt:formatDate pattern="yyyy-MM-dd" value="${entity.dateEnd}" />" /></div></div></div>
<!--usesPerCoupon --><div class="form-row row-fluid"><div class="span12"><div class="row-fluid"><label class="form-label span3" for="usesPerCoupon">UsesPerCoupon :</label><input class="span4" id="usesPerCoupon" name="usesPerCoupon"   type="text" value="${entity.usesPerCoupon}" /></div></div></div>
<!--usesPerCustomer --><div class="form-row row-fluid"><div class="span12"><div class="row-fluid"><label class="form-label span3" for="usesPerCustomer">UsesPerCustomer :</label><input class="span4" id="usesPerCustomer" name="usesPerCustomer"   type="text" value="${entity.usesPerCustomer}" /></div></div></div>
<!--status --><div class="form-row row-fluid"><div class="span12"><div class="row-fluid"><label class="form-label span3" for="status">Status :</label><div class="left marginT5 marginR10"><div class="radio" id="uniform-status1"><span class="<c:if test="${entity.status }">checked</c:if>"><input type="radio" name="status" id="status1" value="true" <c:if test="${entity.status}">checked="checked"</c:if> style="opacity: 0;"></span></div>True</div><div class="left marginT5 marginR10"><div class="radio" id="uniform-status2"><span class="<c:if test="${!entity.status}">checked</c:if>"><input type="radio" <c:if test="${!entity.status}">checked="checked"</c:if>name="status" id="status2" value="false" style="opacity: 0;"></span></div>False</div></div></div></div>



 <div class="form-row row-fluid">
				<div class="span12">
					<div class="row-fluid">
						<div class="form-actions">
							<div class="span3"></div>
							<div class="span4 controls">
								<button type="submit" class="btn btn-info marginR10">Save
									changes</button>
								<button class="btn btn-danger">Cancel</button>
							</div>
						</div>
					</div>
				</div>
			</div>
		</form>

	</div>
	<!-- End .span12 -->

</div>
<!-- End .row-fluid --> 

